home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / ax3.00 / isinlist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-03  |  631 b   |  39 lines

  1. #include "bbs.h"
  2.  
  3. char *IsInList(char *s,char *c,int *length)  /* also used in check_list.c */
  4. {
  5.  int stat,rlength;
  6.  char *p,*ssp;
  7.  char temp[50];
  8.  
  9.  rlength=strlen(s);
  10.  
  11.  *length=0;
  12.  ssp=s;
  13.  do {
  14.         p=stptok(ssp,temp,50," ");
  15.         if(p!=NULL) {
  16.          if(p<s+rlength) {
  17.              if(p==ssp) {
  18.                  ssp=p+1;
  19.                 } else  {
  20.                  stat=StringCompare(temp,c);
  21.                     if(stat==0) {
  22.                      *length=strlen(temp);
  23.                         return(ssp);
  24.                     } else {
  25.                      stat=StringCompare(c,temp);
  26.                         if(stat==0) {
  27.                          *length=strlen(temp);
  28.                             return(ssp);
  29.                         }
  30.                     }
  31.                     ssp=p;
  32.                 }
  33.             } else    p=NULL;
  34.  
  35.         }
  36.     } while(p!=NULL);
  37. return(p);
  38. }
  39.